package com.session03;

public class Main {
    public static void main(String[] args) {
        Polygon p = new Polygon(3);
        p.getNumberOfSides();
        System.out.println(p.toString());

        System.out.println("------------------------------------------");

        Triangle t = new Triangle(3, 4);
        System.out.println(t);
        t.area = t.getArea();
        System.out.println("三角形的面积为：" + t.area);

        System.out.println("------------------------------------------");

        RightTriangle r = new RightTriangle(3, 4);
        //调用toString
        System.out.println(r);
        r.area = r.getArea();
        System.out.println("三角形的面积为：" + r.area);
        r.getNumberOfSides();
    }
}
